package com.delayqueue.common.task;

import com.delayqueue.common.enums.ExecutorType;

import java.time.temporal.ChronoUnit;


public class CycleTask extends Task {

    private int cycleTimeNum;
    private ChronoUnit cycleTimeUnit;

    public CycleTask(ExecutorType executorType, long executeTime, int cycleTimeNum, ChronoUnit cycleTimeUnit) {
        super(executorType, executeTime);
        this.cycleTimeNum = cycleTimeNum;
        this.cycleTimeUnit = cycleTimeUnit;
        this.setCycle(true);
    }

    public int getCycleTimeNum() {
        return cycleTimeNum;
    }

    public void setCycleTimeNum(int cycleTimeNum) {
        this.cycleTimeNum = cycleTimeNum;
    }

    public ChronoUnit getCycleTimeUnit() {
        return cycleTimeUnit;
    }

    public void setCycleTimeUnit(ChronoUnit cycleTimeUnit) {
        this.cycleTimeUnit = cycleTimeUnit;
    }
}
